<template>
	<view class="profile-data d-flex jc-evenly ai-center">
		<view class="item" @tap="openItem(0)">
			<view class="num">{{userData.qiushiNum}}</view>
			<text>糗事</text>
		</view>
		<view class="item" @tap="openItem(1)">
			<view class="num">{{userData.dianzanNum}}</view>
			<text>点赞</text>
		</view>
		<view class="item" @tap="openItem(2)">
			<view class="num">{{userData.commentNum}}</view>
			<text>评论</text>
		</view>
		<view class="item" @tap="openItem(3)">
			<view class="num">{{userData.collectNum}}</view>
			<text>收藏</text>
		</view>
	</view>
</template>

<script>
	import * as userApi from "network/user.js"
	export default {
		data() {
			return {
				userData: {}
			}
		},
		methods: {
			openItem(index) {
				this.$emit("openItem", index)
			}
		},
		created() {
			this.userData = this.$store.state.userData
		}
	}
</script>

<style lang="scss" scoped>
	.profile-data {
		padding: 20upx 0;

		.item {
			color: $uni-text-color-grey;
			text-align: center;

			.num {
				color: $uni-text-color;
				font-weight: bold;
				font-size: 32upx;
			}
		}
	}
</style>
